{% if form.non_field_errors %}
    <div class="alert alert-error">
        {% if form_error_title %}
            <strong>{{ form_error_title }}</strong>
        {% endif %}
        {% for error in form.non_field_errors %}
            {{ error }}<br />
        {% endfor %}
    </div>
{% endif %}
{% for field in form %}
    {% if field.is_hidden %}
        {{ field }}
    {% else %}
        <div class="control-group {% if field.errors %}error{% endif %}">
            <label class="control-label{% if field.field.required %} required-field{% endif %}" for="{{ field.auto_id }}">
                {{ field.label|safe }}
            </label>
            <div class="controls">
                {{ field }}
                {% for error in field.errors %}
                    <span class="help-inline">{{ error }}</span>
                {% endfor %}
                {% if field.help_text %}
                    <p class="help-block">{{ field.help_text|safe }}</p>
                {% endif %}
            </div>
        </div>
    {% endif %}
{% endfor %}
